package com.hxht.cmp.controller;

import com.hxht.cmp.common.enums.ResultCode;
import com.hxht.cmp.common.result.ResultResponse;
import com.hxht.cmp.entity.User;
import com.hxht.cmp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by gaozikun on 2017/7/28 0028.
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("getUserByUid")
    public ResultResponse getUserByUid(User user) {
        if (ObjectUtils.isEmpty(user.getUid())) {
            return ResultResponse.failed(ResultCode.PARAMETER_NULL);
        }
        return ResultResponse.success(userService.selectOne(user));
    }


}
